home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / clipper / nannws35.zip / TTY.PRG < prev    next >
Text File  |  1989-03-01  |  881b  |  33 lines

  1. * Program: Tty.prg
  2. * Author:  Greg Lief
  3. * Version: Clipper Summer '87
  4. * Copyright (c) 1988-89 Greg Lief.
  5. * Placed into Public Domain.
  6. *
  7. * Syntax:  Tty(<row>, <message>, [<delay>, <stop column>])
  8. *
  9. * Thanks to Jeanne Nerwinski, who had the idea in the first
  10. * place, and Jeff Wolach, who suggested the <stop column>.
  11. *
  12.  
  13. FUNCTION Tty
  14. PARAM xrow, msg, delay, stopcol
  15. PRIVATE xcol, yy
  16. * set delay and stop column if parameters were not passed
  17. delay = IF(PCOUNT() < 3, 20, delay)
  18. stopcol = IF(PCOUNT() < 4, -1, stopcol)
  19. xcol = 0
  20. DO WHILE INKEY() = 0 .AND. stopcol != xcol
  21.    @ xrow, xcol SAY CHR(32) + IF(xcol < 79, ;
  22.       SUBSTR(msg, 1, 79 - xcol), '')
  23.    IF 79 - xcol < LEN(msg)
  24.       @ xrow, 0 SAY SUBSTR(msg,80-xcol,LEN(msg)-79+xcol)
  25.    ENDIF
  26.    FOR yy = 1 TO delay
  27.    NEXT
  28.    xcol = IF( xcol = 79, 0, xcol + 1)
  29. ENDDO
  30. RETURN ('')
  31. * EOF: Tty.prg
  32.